Crate do_syscall
source ·Expand description
Note for syscall registers usage (x86-64):
- %rax is the syscall number.
- %rax is also the return value.
- %rdi is the 1st argument.
- %rsi is the 2nd argument.
- %rdx is the 3rd argument.
- %r10 is the 4th argument (yes it’s %r10, not %rcx!).
- %r8 is the 5th argument.
- %r9 is the 6th argument.
syscall
instruction will clobber %r11 and %rcx.